
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>密码重置</title>
    <style type="text/css">



        body{

            background-image: url("images/cc.jpg");
            background-size: cover;
            color: black;
        }
    </style>
</head>
<body>
<form   action="studentupdate"   onsubmit="return check();" method="post">
    <br><br><br><br><br><br><br><br><br>

    <table  align="center" valign="middle"   height="80%" width="40%" >
        <tr>
            <td>学号：&nbsp;</td>
            <td><input type="text" name="studentid" id="studentid" size="25" placeholder="" style="margin-left: 12px;"></td>
        </tr>
        <tr>
            <td>密&nbsp;&nbsp;&nbsp;码：</td>
            <td><input type="password" name="password" id="pw1" size="25"placeholder="密码长度大于4" style="margin-left: 12px;"></td>
        </tr>
        <tr>
            <td>确认密码：</td>
            <td><input type="password" name="password" id="pw2" size="25"placeholder="密码长度大于4" style="margin-left: 12px;"></td>
        </tr>
        <tr>

            <td><input type="submit" value="提交" ></td>
            <td> <input type="button" value="返回" onClick="javascript:history.back (-1)"></td>
        </tr>
    </table>
</form>
</body>
</html>
<script>
    function check()
    {

        //密码验证
        var m=document.getElementById("pw1");
        m=m.value;
        var n=document.getElementById("pw2");
        n=n.value;
        if(m!=n )
        {
            alert("输入密码必须相等");
            return false;
        }
        var m=document.getElementById("pw1");
        m=m.value;
        if(m.length < 5 )
        {
            alert("密码长度大于4");
            return false;
        }
        var m=document.getElementById("pw2");
        m=m.value;
        if(m.length < 5 )
        {
            alert("重置密码长度大于4");
            return false;
        }


    }

</script>

